<!DOCTYPE html>
<html lang="">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  <title>
    linux yum命令详解 | king019
  </title>
  <meta name="description" content>
  
  <meta name="keywords" content="
  yum
  ">
  
  <meta name="author" content="king019">

  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="theme-color" content="#1e2327">
  <link rel="apple-touch-icon" href="https://github.githubassets.com/apple-touch-icon.png">
  <link rel="apple-touch-icon" sizes="180x180" href="https://github.githubassets.com/apple-touch-icon-180x180.png">

  <link rel="icon" type="image/x-icon" href="https://github.githubassets.com/favicon.ico">
  <link rel="stylesheet" href="/css/main.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  

  

  <script src="//cdnjs.cloudflare.com/ajax/libs/vue/1.0.25-csp/vue.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
</head>

<body id="replica-app">

<nav class="navbar-wrapper">
  <div class="navbar">
    <div class="container clearfix">
      <a href="/" class="navbar-logo"><i class="fa fa-github"></i></a>

      <div class="navbar-search float-left desktop-only">
        <div class="navbar-search-form">
          <label for="gsc-i-id1">This website</label>
          <div id="google-search">
            <gcse:search></gcse:search>
          </div>
        </div>
      </div>

      <ul class="navbar-nav float-left">
        
        <li><a href="/archives">Archives</a></li>
        
        
        <li><a href="/categories">Categories</a></li>
        
        
        <li><a href="/tags">Tags</a></li>
        
        
        <li class="desktop-only"><a href="/atom.xml" target="_blank">RSS</a></li>
        
      </ul>

      <ul class="navbar-nav user-nav float-right desktop-only">
        <li class="user-nav-notification">
          <a><span class="user-nav-unread"></span><i class="fa fa-bell"></i></a>
        </li>
        <li>
          <a><i class="fa fa-plus"></i> <i class="fa fa-caret-down"></i></a>
        </li>
        <li class="user-nav-logo">
          <a><img src="/assets/head.jpg"> <i class="fa fa-caret-down"></i></i></a>
        </li>
      </ul>
    </div>
  </div>
</nav>

<div class="main-container">
  <header class="header-wrapper desktop-only">
  <div class="container header-site-detail">
    <ul class="header-toolbar">
      <li class="clearfix">
        <a href="/archives" class="header-toolbar-left"><i
                  class="fa fa-file-text"></i> Posts </a>
        <a href="/archives"
           class="header-toolbar-right"> 67 </a>
      </li>
      <li>
        <a href="/tags" class="header-toolbar-left"><i
                  class="fa fa-tags"></i> Tags </a>
        <a href="/tags"
           class="header-toolbar-right"> 53 </a>
      </li>
      <li>
        <a href="/categories" class="header-toolbar-left"><i
                  class="fa fa-folder-open"></i> Categories </a>
        <a href="/categories"
           class="header-toolbar-right"> 20 </a>
      </li>
    </ul>
    <h2 class="header-title">
      <i class="fa fa-book text-muted"></i>
      <a href="/">king019</a>
      
      
    </h2>
  </div>

  <div class="container">
    <div class="header-tab-wrapper clearfix">
      <span class="header-tab header-tab-selected"><i class="fa fa-thumbs-o-up"></i> Like</span>
      <span class="header-tab"><i class="fa fa-share-alt"></i> Share</span>
      <span class="header-tab"><i class="fa fa-comments-o"></i> Discussion</span>
      <span class="header-tab"><i class="fa fa-bookmark-o"></i> Bookmark </span>
      <span class="header-tab"><i class="fa fa-smile-o"></i> Smile <i class="fa fa-caret-down"></i></span>
    </div>
  </div>
</header>


<div class="post-container container">
  <h3>
    <i class="fa fa-user-o"></i>
    king019

    <span class="post-date float-right" title="{{moment(1615129899326).format('MMM DD, YYYY, h:mm:ss A')}}">
      
          <i class="fa fa-pencil-square-o"></i>
      
      {{moment(1615129899326).fromNow()}}
    </span>
  </h3>

  <article class="post-content">
    <h1>linux yum命令详解</h1>
    <p><a href="https://www.cnblogs.com/liaocheng/p/4243589.html" target="_blank" rel="noopener">linux yum命令详解</a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br></pre></td><td class="code"><pre><span class="line">yum（全称为 Yellow dog Updater, Modified）是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。基於RPM包管理，能够从指定的服务器自动下载RPM包并且安装，可以自动处理依赖性关系，并且一次安装所有依赖的软体包，无须繁琐地一次次下载、安装。yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令，而且命令简洁而又好记。</span><br><span class="line"></span><br><span class="line">yum的命令形式一般是如下：yum [options] [command] [package ...]</span><br><span class="line">其中的[options]是可选的，选项包括-h（帮助），-y（当安装过程提示选择全部为&quot;yes&quot;），-q（不显示安装的过程）等等。[command]为所要进行的操作，[package ...]是操作的对象。</span><br><span class="line"></span><br><span class="line">概括了部分常用的命令包括：</span><br><span class="line"></span><br><span class="line">自动搜索最快镜像插件：   yum install yum-fastestmirror</span><br><span class="line">安装yum图形窗口插件：    yum install yumex</span><br><span class="line">查看可能批量安装的列表： yum grouplist</span><br><span class="line"></span><br><span class="line">1 安装</span><br><span class="line">yum install 全部安装</span><br><span class="line">yum install package1 安装指定的安装包package1</span><br><span class="line">yum groupinsall group1 安装程序组group1</span><br><span class="line"></span><br><span class="line">2 更新和升级</span><br><span class="line">yum update 全部更新</span><br><span class="line">yum update package1 更新指定程序包package1</span><br><span class="line">yum check-update 检查可更新的程序</span><br><span class="line">yum upgrade package1 升级指定程序包package1</span><br><span class="line">yum groupupdate group1 升级程序组group1</span><br><span class="line"></span><br><span class="line">3 查找和显示</span><br><span class="line">yum info package1 显示安装包信息package1</span><br><span class="line">yum list 显示所有已经安装和可以安装的程序包</span><br><span class="line">yum list package1 显示指定程序包安装情况package1</span><br><span class="line">yum groupinfo group1 显示程序组group1信息yum search string 根据关键字string查找安装包</span><br><span class="line"></span><br><span class="line">4 删除程序</span><br><span class="line">yum remove &amp;#124; erase package1 删除程序包package1</span><br><span class="line">yum groupremove group1 删除程序组group1</span><br><span class="line">yum deplist package1 查看程序package1依赖情况</span><br><span class="line"></span><br><span class="line">5 清除缓存</span><br><span class="line">yum clean packages 清除缓存目录下的软件包</span><br><span class="line">yum clean headers 清除缓存目录下的 headers</span><br><span class="line">yum clean oldheaders 清除缓存目录下旧的 headers</span><br><span class="line">yum clean, yum clean all (= yum clean packages; yum clean oldheaders) 清除缓存目录下的软件包及旧的headers</span><br><span class="line"></span><br><span class="line">比如，要安装游戏程序组，首先进行查找：</span><br><span class="line">＃：yum grouplist</span><br><span class="line">可以发现，可安装的游戏程序包名字是”Games and Entertainment“，这样就可以进行安装：</span><br><span class="line">＃：yum groupinstall &quot;Games and Entertainment&quot;</span><br><span class="line">所 有的游戏程序包就自动安装了。在这里Games and Entertainment的名字必须用双引号选定，因为linux下面遇到空格会认为文件名结束了，因此必须告诉系统安装的程序包的名字是“Games and Entertainment”而不是“Games&quot;。</span><br><span class="line"></span><br><span class="line">此外，还可以修改配置文件/etc/yum.conf选择安装源。可见yum进行配置程序有多方便了吧。更多详细的选项和命令，当然只要在命令提示行下面:man yum</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;KDE (K Desktop Environment)&quot;</span><br><span class="line"></span><br><span class="line">yum install pirut k3b mikmod</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Server Configuration Tools&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Sound and Video&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;GNOME Desktop Environment&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Legacy Software Support&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Development Libraries&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Development Tools&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Windows File Server&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;System Tools&quot;</span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;X Window System&quot;</span><br><span class="line"></span><br><span class="line">yum install php-gd</span><br><span class="line">yum install gd-devel</span><br><span class="line">yum groupinstall &quot;Chinese Support&quot;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">yum install samba-common  //该执行会一起安装 samba-client</span><br><span class="line">yum install samba</span><br><span class="line"></span><br><span class="line">yum install gcc</span><br><span class="line">yum install cpp</span><br><span class="line">yum install gcc-c++</span><br><span class="line">yum install ncurses</span><br><span class="line">yum install ncurses-devel</span><br><span class="line">yum install gd-devel php-gd</span><br><span class="line">yum install gd-devel</span><br><span class="line">yum install gcc</span><br><span class="line">yum install cpp</span><br><span class="line">yum install gcc-c++</span><br><span class="line">yum install ncurses</span><br><span class="line">yum install ncurses-devel</span><br><span class="line">yum install gd-devel php-gd</span><br><span class="line">yum install gd-devel</span><br><span class="line">yum install zlib-devel</span><br><span class="line">yum install freetype-devel freetype-demos freetype-utils</span><br><span class="line">yum install libpng-devel libpng10 libpng10-devel</span><br><span class="line">yum install libjpeg-devel</span><br><span class="line">yum install ImageMagick</span><br><span class="line">yum install php-gd</span><br><span class="line">yum install flex</span><br><span class="line">yum install ImageMagick-devel</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#yum install system-config-bind         </span><br><span class="line">#yum groupinstall &quot;DNS Name Server&quot;      //安裝 bind 及 bind-chroot 套件</span><br><span class="line">yum groupinstall &quot;MySQL Database&quot;&apos;</span><br><span class="line"></span><br><span class="line">yum clean all</span><br><span class="line"></span><br><span class="line">-----------------------------------------------------------------------------------------------------------</span><br><span class="line"></span><br><span class="line">装了个fedora linux不能用中文输入是一件很棘手的事，连搜解决方案都没法搜。只能勉强用几个拼音碰碰运气，看Google能不能识别了。而我就遇见了这样的事。</span><br><span class="line">解决方案：</span><br><span class="line">yum install scim* -y</span><br><span class="line"></span><br><span class="line">yum 命令详解：</span><br><span class="line">Redhat和Fedora的软件安装命令是rpm，但是用rpm安装软件最大的麻烦就是需要手动寻找安装该软件所需要的一系列依赖关系，超级 麻烦不说，要是软件不用了需要卸载的话由于卸载掉了某个依赖关系而导致其他的软件不能用是非常恼人的。令人高兴的是，Fedora终于推出了类似于 ubuntu中的apt的命令yum，令Fedora的软件安装变得简单容易。Yum 有以下特点：</span><br><span class="line">*可以同时配置多个资源库(Repository)</span><br><span class="line">*简洁的配置文件(/etc/yum.conf)</span><br><span class="line">*自动解决增加或删除rpm包时遇到的倚赖性问题</span><br><span class="line">*使用方便</span><br><span class="line">*保持与RPM数据库的一致性</span><br><span class="line">yum，是Yellow dog Updater Modified的简称，起初是由yellow dog这一发行版的开发者Terra Soft研发，用python写成，那时还叫做yup(yellow dog updater)，后经杜克大学的Linux@Duke开发团队进行改进，遂有此名。yum的宗旨是自动化地升级，安装/移除rpm包，收集rpm包的相关信息，检查依赖性并自动提示用户解决。yum的关键之处是要有可靠的repository，顾名思义，这是软件的仓库，它可以是http或ftp站点， 也可以是本地软件池，但必须包含rpm的header， header包括了rpm包的各种信息，包括描述，功能，提供的文件，依赖性等.正是收集了这些 header并加以分析，才能自动化地完成余下的任务。</span><br><span class="line">1.yum的一切配置信息都储存在一个叫yum.conf的配置文件中，通常位于/etc目 录下，这是整个yum系统的重中之重，我在的F9中查看了这一文件，大家一起来看下：</span><br><span class="line">[hanlong@localhost F9常用文档]$ sudo more /etc/yum.conf</span><br><span class="line">[main]</span><br><span class="line">cachedir=/var/cache/yum</span><br><span class="line">keepcache=0</span><br><span class="line">debuglevel=2</span><br><span class="line">logfile=/var/log/yum.log</span><br><span class="line">exactarch=1</span><br><span class="line">obsoletes=1</span><br><span class="line">gpgcheck=1</span><br><span class="line">plugins=1</span><br><span class="line">metadata_expire=1800</span><br><span class="line"># PUT YOUR REPOS HERE OR IN separate files named file.repo</span><br><span class="line"># in /etc/yum.repos.d</span><br><span class="line"></span><br><span class="line">下面简单的对这一文件作简要的说明：</span><br><span class="line">cachedir：yum缓存的目录，yum在此存储下载的rpm包和数据库，一般是/var/cache/yum。</span><br><span class="line">debuglevel：除错级别，0──10,默认是2</span><br><span class="line">logfile：yum的日志文件，默认是/var/log/yum.log。</span><br><span class="line">exactarch，有两个选项1和0,代表是否只升级和你安装软件包cpu体系一致的包，如果设为1，则如你安装了一个i386的rpm，则yum不会用686的包来升级。</span><br><span class="line">gpgchkeck= 有1和0两个选择，分别代表是否是否进行gpg校验，如果没有这一项，默认好像也是检查的。</span><br><span class="line">2.好了，接下来就是yum的使用了，首先用yum来升级软件，yum的操作大都须有超级用户的权限，当然可以用sudo。</span><br><span class="line">yum update，这一步是必须的，yum会从服务器的header目录下载rpm的header，放在本地的缓存中，这可能会花费一定的时间，但比起yum 给我们带来方便，这些时间的花费又算的了什么呢？header下载完毕，yum会判断是否有可更新的软件包，如果有，它会询问你的意见，是否更新，还是说 y吧，把系统始终up to date总是不错的，这时yum开始下载软件包并使用调用rpm安装，这可能要一定时间，取决于要更新软件的数目和网络状况，万一网络断了，也没关系，再 进行一次就可以了。升级完毕，以后每天只要使用yum check-update检查一下有无跟新，如果有，就用yum update进行跟新，时刻保持系统为最新，堵住一切发现的漏洞。用yum update packagename 对某个单独包进行升级。</span><br><span class="line">现在简单的把yum软件升级的一些命令罗列一下：</span><br><span class="line">(更新：我在安装wine的时候是用rpm一个一个安装的，先安装以来关系，然后在安装wine的主包，但是刚刚在论坛上发现来一个好的帖子，就yum的本地安装。参数是-localinstall</span><br><span class="line">$yum localinstall wine-*</span><br><span class="line">这样的话，yum会自动安装所有的依赖关系，而不用rpm一个一个的安装了，省了好多工作。</span><br><span class="line">还有一个与他类似的参数：</span><br><span class="line">$yum localupdate wine-*</span><br><span class="line">如果有wine的新版本，而且你也下载到来本地，就可以这样本地更新wine了。)</span><br><span class="line"></span><br><span class="line">1.列出所有可更新的软件清单</span><br><span class="line">命令：yum check-update</span><br><span class="line"></span><br><span class="line">2.安装所有更新软件</span><br><span class="line">命令：yum update</span><br><span class="line"></span><br><span class="line">3.仅安装指定的软件</span><br><span class="line">命令：yum install</span><br><span class="line"></span><br><span class="line">4.仅更新指定的软件</span><br><span class="line">命令：yum update</span><br><span class="line"></span><br><span class="line">5.列出所有可安裝的软件清单</span><br><span class="line">命令：yum list</span><br><span class="line"></span><br><span class="line">3.使用yum安装和卸载软件，有个前提是yum安装的软件包都是rpm格式的。</span><br><span class="line">安装的命令是，yum install xxx，yum会查询数据库，有无这一软件包，如果有，则检查其依赖冲突关系，如果没有依赖冲突，那么最好，下载安装;如果有，则会给出提示，询问是否要同时安装依赖，或删除冲突的包，你可以自己作出判断</span><br><span class="line">删除的命令是，yum remove xxx，同安装一样，yum也会查询数据库，给出解决依赖关系的提示。</span><br><span class="line">1.用YUM安装软件包</span><br><span class="line">命令：yum install</span><br><span class="line"></span><br><span class="line">2.用YUM删除软件包</span><br><span class="line">命令：yum remove</span><br><span class="line"></span><br><span class="line">4.用yum查询想安装的软件</span><br><span class="line">我们常会碰到这样的情况，想要安装一个软件，只知道它和某方面有关，但又不能确切知道它的名字。这时yum的查询功能就起作用了。你可以用 yum search keyword这样的命令来进行搜索，比如我们要则安装一个Instant Messenger，但又不知到底有哪些，这时不妨用 yum search messenger这样的指令进行搜索，yum会搜索所有可用rpm的描述，列出所有描述中和messeger有关的rpm包，于是我们可能得到 gaim，kopete等等，并从中选择。</span><br><span class="line">有时我们还会碰到安装了一个包，但又不知道其用途，我们可以用yum info packagename这个指令来获取信息。</span><br><span class="line">1.使用YUM查找软件包</span><br><span class="line">命令：yum search</span><br><span class="line">2.列出所有可安装的软件包</span><br><span class="line">命令：yum list</span><br><span class="line">3.列出所有可更新的软件包</span><br><span class="line">命令：yum list updates</span><br><span class="line">4.列出所有已安装的软件包</span><br><span class="line">命令：yum list installed</span><br><span class="line">5.列出所有已安装但不在 Yum Repository 內的软件包</span><br><span class="line">命令：yum list extras</span><br><span class="line">6.列出所指定的软件包</span><br><span class="line">命令：yum list 7.使用YUM获取软件包信息</span><br><span class="line">命令：yum info 8.列出所有软件包的信息</span><br><span class="line">命令：yum info</span><br><span class="line">9.列出所有可更新的软件包信息</span><br><span class="line">命令：yum info updates</span><br><span class="line">10.列出所有已安裝的软件包信息</span><br><span class="line">命令：yum info installed</span><br><span class="line">11.列出所有已安裝但不在 Yum Repository 內的软件包信息</span><br><span class="line">命令：yum info extras</span><br><span class="line">12.列出软件包提供哪些文件</span><br><span class="line">命令：yum provides</span><br><span class="line"></span><br><span class="line">5.清除YUM缓存</span><br><span class="line">yum 会把下载的软件包和header存储在cache中，而不会自动删除。如果我们觉得它们占用了磁盘空间，可以使用yum clean指令进行清除，更精确的用法是yum clean headers清除header，yum clean packages清除下载的rpm包，yum clean all 清除所有</span><br><span class="line">1.清除缓存目录(/var/cache/yum)下的软件包</span><br><span class="line">命令：yum clean packages</span><br><span class="line"></span><br><span class="line">2.清除缓存目录(/var/cache/yum)下的 headers</span><br><span class="line"></span><br><span class="line">命令：yum clean headers</span><br><span class="line"></span><br><span class="line">3.清除缓存目录(/var/cache/yum)下旧的 headers</span><br><span class="line"></span><br><span class="line">命令：yum clean oldheaders</span><br><span class="line"></span><br><span class="line">4.清除缓存目录(/var/cache/yum)下的软件包及旧的headers</span><br><span class="line"></span><br><span class="line">命令：yum clean, yum clean all (= yum clean packages; yum clean oldheaders)</span><br><span class="line"></span><br><span class="line">以上所有命令参数的使用都可以用man来查看：</span><br><span class="line">1、安装图形版yumex：yum install yumex。</span><br><span class="line">2、安装额外的软件仓库：</span><br><span class="line">rpm.livna.org 的软件包仓库:</span><br><span class="line">rpm -ivh http://livna-dl.reloumirrors.net … ease-7-2.noarch.rpm</span><br><span class="line"></span><br><span class="line">freshrpms.net 的软件包仓库:</span><br><span class="line">rpm –ivh http://ftp.freshrpms.net/pub/fre … 1.1-1.fc.noarch.rpm</span><br><span class="line"></span><br><span class="line">3、安装最快源 yum install yum-fastestmirror</span><br><span class="line"></span><br><span class="line">资源真的是非常丰富，从Centos到Ubuntu，ISO镜像、升级包，应有尽有，上交的兄弟们真是幸福，羡慕啊。不过还好，我们好歹也算是在教育网内，凑合着也可以沾点光，下载一些。</span><br><span class="line">网址为：ftp://ftp.sjtu.edu.cn/</span><br><span class="line"></span><br><span class="line">相应的yum的repo为</span><br><span class="line">[updates]</span><br><span class="line">name=Fedora updates</span><br><span class="line">baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/updates/$releasever/$basearch/</span><br><span class="line">enabled=1</span><br><span class="line">gpgcheck=0</span><br><span class="line">[fedora]</span><br><span class="line">name=Fedora $releasever - $basearch</span><br><span class="line">baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/releases/$releasever/Everything/$basearch/os/</span><br><span class="line">enabled=1</span><br><span class="line">gpgcheck=1</span><br><span class="line">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY</span><br><span class="line"></span><br><span class="line">如果在机器上安装了apt管理器，则相应的源为</span><br><span class="line">repomd ftp://ftp.sjtu.edu.cn/ fedora/linux/updates/$(VERSION)/$(ARCH)/</span><br><span class="line"></span><br><span class="line">repomd ftp://ftp.sjtu.edu.cn/ fedora/linux/releases/$(VERSION)/Everything/$(ARCH)/os/</span><br><span class="line"></span><br><span class="line">这与前面yum的源的格式上有一些差别，需要加以注意。</span><br><span class="line">下面介绍一下fedora 下安装 scim</span><br><span class="line"></span><br><span class="line">1． 什么输入法适合我？</span><br><span class="line">fcitx和scim是目前比较好的输入法， 但是他们的特点不同，fcitx只能输入中文，而scim可以根据需要，利用不同的码表达到中英日…等等各种语言的输入问题。如果你只懂中文，或者只会输 入英文&amp;中文，那么fcitx是一个不错的选择，因为它漂亮，小巧，实用。如果你还需要输入日文或者其他语言，那么你因该安装scim。通 过合理的配置，他能够让你像在windows里面一样，想输入什么语言就能输入什么语言，同一种语言想用什么输入法就用什么输入法。Scim的扩充性很 强，而且比较稳定，我就是选择的是scim.</span><br><span class="line">2． 安装一个新输入法前需要哪些准备？</span><br><span class="line">如果你选择fcitx或者scim，那么我建议你删除系统自带的中文输入法。方法如下：</span><br><span class="line">rpm –qa | grep iiimf | xargs rpm –e</span><br><span class="line">rpm –qa | grep Chinput| xargs rpm –e</span><br><span class="line">如果有哪一行提示rpm: no packages given for erase那表示本身你的系统里面没有该输入法，不用担心，继续往下看就行了。</span><br><span class="line">说 明：rpm –qa是列出所有安装的rpm包，grep iiimf是选择出其中名字含有iiimf的那些包，xargs rpm –e的意思是把前面列出的这些包删除掉。Xargs的作用就是把前面通过 | 传过来的数据作为下面命令的参数。这就好比一个过滤器，首先是放着所有的安装包，然后grep以后，只留下了含有某些特定关键字的rpm包，然后通过 xargs和rpm –e的组合运用，把剩下的这些含有某特定关键字的包删掉。这样就达到了删除该输入法及相关包的目的。下面的Chinput也是如此，在此不再重复。如果你还安装了其他输入法，比如你原来装的是fcitx，现在想装scim，那么你最好模仿上面的样子把fcitx删除，方法就是把iiimf的位置改成 fcitx就可以了。</span><br><span class="line">在安装新输入法之前，最好这样做一下，因为多种输入法同时存在一个系统中没有什么好处，你只可能去用一个，而且他们同时存在可能有的时候会出现问题，想想也知道，会互相竞争嘛。所以在此以后，你应该保证系统里面已经没有中文输入法了。通过类似以下方式验证：</span><br><span class="line">whereis fcitx</span><br><span class="line">whereis scim</span><br><span class="line">whereis miniChinput</span><br><span class="line">…</span><br><span class="line"></span><br><span class="line">3． 输入法是何时被系统调用的？</span><br><span class="line">很多人不知道输入法到底什么时候被load进来，不知道这个当然就不知道为什么有的时候呼不出输入法（因为可能根本没有调入）当然也不会知道如何配置能够符合自己的要求。</span><br><span class="line">大 家都知道，linux下面比较常用的有两个桌面系统，gnome和kde，这都无所谓，他们其实都是架在X系统之上的。简单的说X系统就是一个最核心，也 是最底层的桌面系统，gnome也好，kde也罢，或者其他的什么fvwm之类的，都只不过是X系统和用户之间的另一层软件而已。所以要想达到不管使用什 么桌面系统，都能调入输入法，就是要在X系统启动的时候，让输入法也启动起来，那么这样之后，无论你使用的是gnome还是kde或者其他什么桌面，都能 够调入输入法。因为当轮到他们启动的时候，X系统已经启动好了，输入法已经被系统调入了。那么X系统又是如何启动的呢？让我们从startx开始说起。</span><br><span class="line">无论你用什么桌面系统，都是通过startx启动的，那么startx究竟是什么呢？一个应用程序还是一个脚本文件？为什么它能够启动各种桌面系统，并且能够按照相应的配置文件来设置呢？带着疑问，我在console里面输入whereis startx.</span><br><span class="line">在 找到了存放startx的路径以后，用编辑器打开它发现原来是一个脚本文件。这个脚本文件的内容可能根据发行版不同，会有差异，如果你懂一些shell的 语言，那么你可以尝试看看，不一定要全部看懂，但是你大致看过以后会发现最后有一个xinit的命令，然后跟着一些参数。我尝试在console下面输入 xinit(注意，不要在图形界面下做此操作)</span><br><span class="line">发现图形界面启动拉，但是很丑陋，什么功能都没有，鼠标可以动，还有一个可以输入命令的小窗口。怎 么退出来？ctrl+alt+backspace. 原来如此，startx只是一个脚本，里面通过对一系列配置文件的分析设置，最终利用xinit命令启动图形界面。不管是kde还是gnome，都是在这 个脚本中完成的。那么让我们再打开startx脚本看看里面还做了些什么。你仔细看看，会发现有一个东西很显眼，就是/etc/X11/xinit /xinitrc，这个xinitrc好像很眼熟，在配置输入法的其他贴中总是看到，这里出现了肯定是里面运行了这个脚本。再看其他的一些东西，其实都是利用shell配置出一个xinit启动的参数，用来配置桌面系统用的，不用管它。目前已知的就是startx的时候它会去执行一个/etc/X11 /xinit/xinitrc的脚本，让我们打开来看看里面有什么。</span><br><span class="line">打开一看，其中一段我觉得最有价值，是一个for循环，他依次执行了/etc /X11/xinit/xinitrc.d/下面的所有脚本。你可以耐心的找一下，一定可以发现。那么这个目录里面有些什么内容呢？有一个文件看名字就知道和输入相关，他叫xinput。等等，让我们理一下，是怎么从startx到xinput的。</span><br><span class="line">首先是执行startx这个脚本文件，里面他会执行xinitrc这个脚本，然后xinitrc脚本里面的，叫xinput。OK, 我们继续，打开xinput看看。</span><br><span class="line">4.安装软件包</span><br><span class="line">rpm -Uvh scim-0.8.2-1.i586.rpm</span><br><span class="line">rpm -Uvh scim-chinese-0.2.6-1.i586.rpm</span><br><span class="line"></span><br><span class="line">5.修改配置文件</span><br><span class="line">接下来重要的一步就是，修改一下</span><br><span class="line">/etc /X11/xinit/xinitrc.d/xinput文件，让SCIM在X启动的时候也启动。我看到网上很多文章也说过，但总是不得要领，经过自己试 验，最简单的就是把xinput文件里的Chinput全部替换为SCIM，chinput替换为scim，保存重启X就可以了。</span><br><span class="line">zh_CN*)</span><br><span class="line">     if [ -e /usr/bin/scim ]; then</span><br><span class="line">   XIM=&quot;SCIM&quot;</span><br><span class="line">            elif [ -e /usr/X11R6/bin/xcin ] ; then</span><br><span class="line">                 export LC_CTYPE=zh_CN.GB2312</span><br><span class="line">                 XIM=&quot;xcin-zh_CN.GB2312&quot;  </span><br><span class="line">     fi</span><br><span class="line">;;</span><br><span class="line"></span><br><span class="line">..............................</span><br><span class="line"></span><br><span class="line">SCIM)</span><br><span class="line">XIM_PROGRAM=scim</span><br><span class="line">        XIM_ARGS=&quot;-d&quot;</span><br><span class="line">;;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">然后修改/etc/gtk-2.0/gtk.immodules，找到这一行:</span><br><span class="line">&quot;xim&quot; &quot;X Input Method&quot; &quot;gtk20&quot; &quot;/usr/share/locale&quot; &quot;ko:ja:zh&quot;</span><br><span class="line">改为：</span><br><span class="line">&quot;xim&quot; &quot;X Input Method&quot; &quot;gtk20&quot; &quot;/usr/share/locale&quot; &quot;en:ko:ja:zh&quot;</span><br><span class="line">可能表示输入英文时也使用该输入法</span><br><span class="line"></span><br><span class="line">安装完毕后运行scim-setup,将输入法的切换键改为ctrl+space</span><br></pre></td></tr></table></figure>


  </article>
</div>


    




</div>

<div class="footer-wrapper container">
  <footer class="footer clearfix">
    <div class="clearfix">
    <a href="https://king019.github.io" class="footer-logo">
      <i class="fa fa-github"></i>
    </a>
    <ul class="footer-social-link">
      <li>© 2019 king019</li>
      <li><a href="https://king019.github.io">Home</a></li>
      
      <li><a href="https://github.com/king019">Github</a></li>
      
    </ul>
    <div class="footer-theme-info">
      Theme <a href="//github.com/sabrinaluo/hexo-theme-replica">Replica</a>
      by <a href="//github.com/sabrinaluo">Hiitea</a> ❤ Powered by Hexo
    </div>
    </div>
    
  </footer>
</div>




<script src="/js/main.js"></script>

</body>
</html>
